Fix in-place indexing with range/list for 4D arrays#2872
Open
vlad-perevezentsev wants to merge 5 commits intomasterfrom
Open
Fix in-place indexing with range/list for 4D arrays#2872vlad-perevezentsev wants to merge 5 commits intomasterfrom
vlad-perevezentsev wants to merge 5 commits intomasterfrom
Conversation
Contributor
|
Array API standard conformance tests for dpnp=0.21.0dev0=py313h509198e_5 ran successfully. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR proposes to fix #2783 by addressing incorrect in-place updates for 4D arrays.
_is_boolean()in_slicing.pxihad a__bool__fallback that misclassifiedrangeobjects as boolean scalar indices sincerangeexposes__bool__. This caused them to insertnewaxis(1)instead of being treated as integer index arrays.The fallback was removed because all legitimate boolean types are already caught by earlier checks in the same function.
rangeandlistare not part of the Python Array API indexing spec but NumPy accepts them as integer index arrays.Conversion of these types to numpy arrays is added in
_get_unwrapped_index_key()indpnp_array.pywhich is the NumPy compatibility layer but keeping the tensor layer Array API compliant.Also added tests for
rangeandlistadvanced indexing covering totest_indexing.py